package asia.yuanding.wechat.system.config;

import asia.yuanding.wechat.system.intercept.LoginIntercept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName: MVCConfig
 * @Author: YuanDing
 * @Date: 2025/7/26 10:46
 * @Description: mvc配置类
 */

@Configuration
public class MVCConfig implements WebMvcConfigurer {
    @Autowired
    private LoginIntercept loginIntercept;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        // 添加登录拦截器
        registry.addInterceptor(loginIntercept).excludePathPatterns("/user/login" , "/user/register" , "/user/code");

    }
}
